import request from '@/utils/request'

enum API {
    // spu列表接口
    SPUURL = '/admin/product/',
    // 品牌列表接口
    TRADEMARKLIST = '/admin/product/baseTrademark/getTrademarkList',
    // 照片墙接口
    IMGLIST = '/admin/product/spuImageList/',
    // 销售属性接口
    BASESALES = '/admin/product/baseSaleAttrList',
    // 商品已有销售属性接口
    HADSALES = '/admin/product/spuSaleAttrList/',
}

// 获取SPU列表的数据
export const reqSpuList = (page: number, limit: number, category3Id: number | string) => request.get(API.SPUURL + `${page}/${limit}?category3Id=${category3Id}`)

// 获取品牌列表的数据
export const reqTrademarkData = () => request.get(API.TRADEMARKLIST)

// 获取照片墙的数据
export const reqImgList = (spuId: number) => request.get(API.IMGLIST + spuId)

// 获取基础销售属性接口
export const reqBaseSaleAttr = () => request.get(API.BASESALES)

// 获取已有销售属性接口
export const reqHadSaleAttr = (spuId: number) => request.get(API.HADSALES + spuId)